package io.gitee.icefairy.total_monitor

import cn.hutool.db.Db
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.stereotype.Component
import javax.sql.DataSource

/**
 * AUTHOR:icefairy
 * DATE:2021/12/22 0022 16:01
 **/
@Component("DbConfig")
open class DbConfig {
    @Autowired
    lateinit var ds: DataSource

    @Bean
    fun genDb(): Db {
        return cn.hutool.db.Db.use(ds)
    }
}